﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.Domain.Query.TagConfig
{
    /// <summary>
    /// 标签配置实体查询
    /// </summary>
    public class TagConfigDetailQuery
    {
        /// <summary>
        /// 不等于
        /// </summary>
        public long? TagIdNeq { get; set; }
        public long? TagId { get; set; }
        public string? GroupKey { get; set; }
        public string? TagLabel { get; set; }

        public Expression<Func<furion.blog.Domain.MySQL.TagConfig, bool>> Exp() {
            var exp = Expressionable.Create<furion.blog.Domain.MySQL.TagConfig>();
            exp.AndIF(TagId!=null,t=>t.TagId == TagId);
            exp.AndIF(!string.IsNullOrWhiteSpace(GroupKey), t => t.GroupKey == GroupKey);
            exp.AndIF(!string.IsNullOrWhiteSpace(TagLabel),t=>t.TagLabel == TagLabel);
            exp.AndIF(TagIdNeq != null, t => t.TagId != TagId);
            return exp.ToExpression();
        }

    }
}
